/**
 * Created by jihb on 5/2/16.
 */
Ext.define('JYnovel.controller.novel.NovelCategoryController',{
    extend:'Ext.app.Controller',
    views:[
        'novel.NovelCategoryView',
        'novel.NovelCategoryForm'
    ],
    models:[
        'novel.NovelCategoryModel'
    ],
    stores:[
        'novel.NovelCategoryTreeStore'
    ],
    refs:[{
        ref:'NovelCategoryTreePanel',
        selector:'NovelCategoryTreePanel'
    },{
        ref:'NovelCategoryForm',
        selector:'NovelCategoryForm'
    }],
    init:function () {
        this.control({
            'NovelCategoryTreePanel button[name=novelCategoryAddBtn]':{
                click:this.novelCategoryAddBtnClick
            },
            'NovelCategoryForm button[name=novelCategoryOkBtn]':{
                click:this.novelCategoryOkBtnClick
            }
        });
    },
    novelCategoryAddBtnClick:function () {
        this.showCategoryForm("添加分类");
    },
    showCategoryForm:function (title,id) {
        var form = Ext.create('JYnovel.view.novel.NovelCategoryForm');
        form.showFormWin(title,id);
    },
    NovelCategoryForm:function () {

    },
    submitCategoryForm:function () {
        
    }
});